package simplefactory.factory;

import simplefactory.service.AwardInterface;
import simplefactory.service.impl.AiQiYiInfo;
import simplefactory.service.impl.DiscountInfo;
import simplefactory.service.impl.SmallGiftInfo;
import simplefactory.vo.AwardInput;
import simplefactory.vo.Result;

/**
 * @Author liangbaigao
 * @Date 2023/9/25 12:48
 */
public class AwardFactory {

    public Result sendAward(AwardInput input){
        // 1 打折券 ,2 爱奇艺会员,3 小礼品
        AwardInterface awardInterface = null;
        if(input.getType().equals("1")){
            awardInterface = new DiscountInfo();
            awardInterface.sendAward();
        }

        if(input.getType().equals("2")){
            awardInterface = new AiQiYiInfo();
            awardInterface.sendAward();
        }

        if(input.getType().equals("3")){
            awardInterface = new SmallGiftInfo();
            awardInterface.sendAward();
        }

        return new Result(awardInterface,"200","ok");
    }


}
